package br.schindler.android.wallpaper.milkyway;

public class PlanetEarth extends CelestialBody {
	
	private CelestialBody moon;

	/**
	 * 
	 * @param a
	 * @param r
	 */
	public PlanetEarth(double a, double r) {
		super(a, r);
		//Eccentricity of orbit
		ec = .01671022;

		//Period of orbit (seconds)
		P = 365.242;
		 
		//Longitude of asending node 48.331°
		F = (-11.26064 * Math.PI) / 180;

		//Longitude of perihelion 77.45645°
		o = (102.94719 * Math.PI) / 180;

		//Angle between plane of sun's equator and plane X'sorbit
		i = 0;	
		
		//Rotation
		this.r = 1;
		
		moon = new Moon(this, getRadius()*3, getRadius()/4);		
	}		
	
	/*
	 * (non-Javadoc)
	 * @see br.schindler.physics.test.Body#getSatellite()
	 */
	@Override
	public CelestialBody getSatellite(){
		return moon;
	}
	
	/**
	 * 
	 */
	protected class Moon extends CelestialBody {

		/**
		 * 
		 * @param a
		 * @param r
		 */
		public Moon(CelestialBody center, double a, double r) {
			super(center, a, r);	
			
			//Eccentricity of orbit
			ec = 0.0549;

			//Period of orbit (seconds)
			P = 27.3217;
			 
			//Longitude of asending node 48.331°
			F = 0;

			//Longitude of perihelion 77.45645°
			o = 0;

			//Angle between plane of sun's equator and plane X'sorbit
			i = (5 * Math.PI) / 180;			
		}
	}
}
